const modulesConstant = import.meta.webpackContext("../constant/", {
	recursive: false,
	regExp: /\.js$/
});

const constantMap = {};
modulesConstant.keys().forEach(key => {
	const name = key.replace(/^\.\/(.*)\.\w+$/, '$1').split('/')[0];
	constantMap[name] = modulesConstant(key)
})

const $globalConstant = (modelName) => {
	return constantMap[modelName]
}

export { $globalConstant };
